import { Column, CreateDateColumn, Entity, PrimaryColumn, UpdateDateColumn } from "typeorm";
export enum SpiderTaskType {
    UNKNOWN = 0,
}
export enum SpiderTaskStatus {
    UNKNOWN = 0,
}
/**
 * 爬虫任务库
 */
@Entity({
    name: 'spider_task'
})
export class SpiderTask {
    @PrimaryColumn()
    uuid: string;

    @Column({ default: 0, type: 'tinyint', comment: '任务状态' })
    status: SpiderTaskStatus;

    @Column({ default: 0, type: 'tinyint', comment: '任务类型' })
    type: SpiderTaskType;

    @Column({ type: 'jsonb', nullable: true, comment: '任务参数' })
    payload: any;

    @Column({ default: 0 })
    displayorder: number;

    @UpdateDateColumn()
    udpate_date: Date;

    @CreateDateColumn()
    create_date: Date;
}

@Entity({
    name: 'spider_sub_task'
})
export class SpiderSubTask {
    @PrimaryColumn()
    uuid: string;

    @Column()
    task_id: string;

    @Column({ default: 0, type: 'tinyint', comment: '任务类型' })
    type: SpiderTaskType;

    @Column({ type: 'jsonb', nullable: true, comment: '任务参数' })
    payload: any;

    @Column({ default: 0, type: 'tinyint', comment: '任务状态' })
    status: SpiderTaskStatus;

    @Column({ default: 0 })
    displayorder: number;
}